from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework.permissions import IsAuthenticated
from dhm.models.produce.produce import Produce

class ProduceView(APIView):
    def get(self, request):
        produces = Produce.objects.all()
        data = []
        for produce in produces:
            data.append({
                'photo': produce.photo,
                'produce_name': produce.produce_name,
            })
        return Response(data)
